<?php
session_start();
$string = '';
$_SESSION['rand_code'] = $string;

for ($i = 0; $i < 5; $i++) {
	$string .= chr(rand(98, 122));
}
$font = 'COURBD.TTF';
$image = imagecreatetruecolor(170, 50);
$color = imagecolorallocate($image, 0, 0, 0); // text color
$white = imagecolorallocate($image, 255, 255, 255); // background color

imagefilledrectangle($image, 0, 0, 399 ,99, $white);
imagettftext ($image, 30, 0, 15, 40, $color, $font, $string);

header("Content-type: image/png");
imagepng($image);



?>